
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>系统配置参数</title>
        <script language="javascript" src="<?php echo base_url();?>public/js/dedeajax2.js"></script>
        <script language="javascript">
            var searchconfig = false;
            function Nav()
            {
                if(window.navigator.userAgent.indexOf("MSIE")>=1) return 'IE';
                else if(window.navigator.userAgent.indexOf("Firefox")>=1) return 'FF';
                else return "OT";
            }
            function $Obj(objname)
            {
                return document.getElementById(objname);
            }
            function ShowConfig(em,allgr)
            {
                if(searchconfig) location.reload();
                for(var i=1;i<=allgr;i++)
                {
                    if(i==em) $Obj('td'+i).style.display = (Nav()=='IE' ? 'block' : 'table');
                    else $Obj('td'+i).style.display = 'none';
                }
                $Obj('addvar').style.display = 'none';
            }

            function ShowHide(objname)
            {
                var obj = $Obj(objname);
                if(obj.style.display != "none") obj.style.display = "none";
                else obj.style.display = (Nav()=='IE' ? 'block' : 'table-row');
            }

            function backSearch()
            {
                location.reload();
            }
            function getSearch()
            {
                var searchKeywords = $Obj('keywds').value;
                var myajax = new DedeAjax($Obj('_search'));
                myajax.SendGet('sys_info.php?dopost=search&keywords='+searchKeywords)
                $Obj('_searchback').innerHTML = '<input name="searchbackBtn" type="button" value="返回" id="searchbackBtn" onclick="backSearch()"/>'
                $Obj('_mainsearch').innerHTML = '';
                searchconfig = true;
            }
        </script>
        <link href="<?php echo base_url();?>public/css/base.css" rel="stylesheet" type="text/css">
    </head>
    <body background='<?php echo base_url();?>public/images/allbg.gif' leftmargin='8' topmargin='8'>
        <div style="min-width:780px">
            <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D6D6D6" align="center">
                <tr>
                    <td height="28" background="<?php echo base_url();?>public/images/tbg.gif" style="padding-left:10px;"><b>系统配置参数：</b></td>
                </tr>
                <tr>
                    <td height="24" bgcolor="#ffffff" align="center"> <a href='javascript:ShowConfig(1,8)'>站点设置</a> <!--  | <a href='javascript:ShowConfig(2,8)'>核心设置</a> | <a href='javascript:ShowConfig(3,8)'>附件设置</a>  | <a href='javascript:ShowConfig(4,8)'>会员设置</a>  | <a href='javascript:ShowConfig(5,8)'>互动设置</a>  | <a href='javascript:ShowConfig(6,8)'>性能选项</a>  | <a href='javascript:ShowConfig(7,8)'>其它选项</a>  | <a href='javascript:ShowConfig(8,8)'>模块设置</a>     | <a href="#" onClick="ShowHide('addvar')">添加新变量</a>--></td>
                </tr>
            </table>
            <table width="98%" border="0" cellpadding="0" cellspacing="0" style="margin-top:10px" bgcolor="#D6D6D6" align="center">

                <tr>
                    <td bgcolor="#FFFFFF" width="100%"><form action="<?php echo site_url("admin/system/info")?>" method="post" name="form1">
                            <input type="hidden" name="dopost" value="save">
                            <div id="_search"></div>
                            <div id="_mainsearch">


                                <table width="100%" style='' id="td1" border="0" cellspacing="1" cellpadding="1" bgcolor="#cfcfcf">
                                    <tr align="center" bgcolor="#FBFCE2" height="25">
                                        <td width="300">参数说明</td>
                                        <td>参数值</td>
                                        <td width="220">变量名</td>
                                    </tr>

                                  
                                    <?php 


                                        $i = 1;
                                        foreach($model->result() as $row)
                                        {
                                            if($i%2==0)
                                            {
                                                $bgcolor = "#F9FCEF";
                                            }
                                            else
                                            {
                                                $bgcolor = "#ffffff";
                                            }
                                            $i++;
                                        ?>
                                        <tr align="center" height="25" bgcolor="<?php echo $bgcolor?>">
                                            <td width="300"><?php echo $row->info; ?>： </td>
                                            <td align="left" style="padding:3px;"><?php
                                                    if($row->type=='bool')
                                                    {
                                                        $c1='';
                                                        $c2 = '';
                                                        $row->value=='Y' ? $c1=" checked" : $c2=" checked";
                                                        echo "<input type='radio' class='np' name='edit___{$row->varname}' value='Y'$c1>是 ";
                                                        echo "<input type='radio' class='np' name='edit___{$row->varname}' value='N'$c2>否 ";
                                                    }else if($row->type=='bstring')
                                                    {
                                                        echo "<textarea name='edit___{$row->varname}' row='4' id='edit___{$row->varname}' class='textarea_info' style='width:98%;height:50px'>".htmlspecialchars($row->value)."</textarea>";
                                                    }else if($row->type=='number')
                                                    {
                                                        echo "<input type='text' name='edit___{$row->varname}' id='edit___{$row->varname}' value='{$row->value}' style='width:30%'>";
                                                    }else
                                                    {
                                                        echo "<input type='text' name='edit___{$row->varname}' id='edit___{$row->varname}' value=\"".htmlspecialchars($row->value)."\" style='width:80%'>";
                                                    }
                                            ?></td>
                                            <td><?php echo $row->varname?></td>
                                        </tr>
                                        <?php
                                        }

                                    ?>

                                 



                                              









                                </table>


                            </div>
                            <table width="100%" border="0" cellspacing="1" cellpadding="1"  style="border:1px solid #cfcfcf;border-top:none;">
                                <tr bgcolor="#F9FCEF">
                                    <td height="50" colspan="3"><table width="98%" border="0" cellspacing="1" cellpadding="1">
                                            <tr>
                                                <td width="11%">&nbsp;</td>
                                                <td width="11%"><input name="imageField" type="image" src="<?php echo base_url();?>public/images/button_ok.gif" width="60" height="22" border="0" class="np"></td>
                                                <td width="78%"><img src="<?php echo base_url();?>public/images/button_reset.gif" width="60" height="22" style="cursor:pointer" onClick="document.form1.reset()"></td>
                                            </tr>
                                        </table></td>
                                </tr>
                            </table>
                        </form></td>
                </tr>
            </table>
        </div>
    </body>
</html>